<template>
  <div>
    <h1>用户登录</h1>
    <input type="text" v-model="username" placeholder="用户名">
    <input type="password" v-model="password" placeholder="密码">
    <button @click="login">登录</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: 'admin',
      password: '123456'
    };
  },
  methods: {
    login() {
      // 模拟用户登录
      if (this.username === 'admin' && this.password === '123456') {
        localStorage.setItem('loggedIn', true); // 将登录状态保存到本地存储
        this.$router.push('/student-system'); // 登录成功，跳转到学生管理系统页面
      } else {
        alert('用户名或密码错误');
      }
    }
  }
};
</script>
